/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.fx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.fx.entity.SysUserdealerprivilege;
import com.vivo.fx.dao.SysUserdealerprivilegeDao;

/**
 * 优信通用户经销商权限Service
 * @author jyangye
 * @version 2018-04-17
 */
@Service
@Transactional(readOnly = true)
public class SysUserdealerprivilegeService extends CrudService<SysUserdealerprivilegeDao, SysUserdealerprivilege> {

    @Autowired
    private SysUserdealerprivilegeDao sysUserdealerprivilegeDao;

	public SysUserdealerprivilege get(String id) {
		return super.get(id);
	}

	public List<SysUserdealerprivilege> getListByUserid(String userid) {
	    SysUserdealerprivilege query = new SysUserdealerprivilege();
	    query.setUserid(userid);

	    return findList(query);
    }
	
	public List<SysUserdealerprivilege> findList(SysUserdealerprivilege sysUserdealerprivilege) {
		return super.findList(sysUserdealerprivilege);
	}
	
	public Page<SysUserdealerprivilege> findPage(Page<SysUserdealerprivilege> page, SysUserdealerprivilege sysUserdealerprivilege) {
		return super.findPage(page, sysUserdealerprivilege);
	}
	
	@Transactional(readOnly = false)
	public void save(SysUserdealerprivilege sysUserdealerprivilege) {
		super.save(sysUserdealerprivilege);
	}
	
	@Transactional(readOnly = false)
	public void delete(SysUserdealerprivilege sysUserdealerprivilege) {
		super.delete(sysUserdealerprivilege);
	}


	@Transactional(readOnly = false)
    public void deleteByUserid(String userid) {
	    sysUserdealerprivilegeDao.deleteByUserid(userid);
    }
}